<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Kinetis Bootloader Host: RijndaelCBCMAC Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Kinetis Bootloader Host
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
   <div id="projectbrief">Host Tools for Kinetis devices</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Introduction</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_rijndael_c_b_c_m_a_c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="class_rijndael_c_b_c_m_a_c-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">RijndaelCBCMAC Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Class to compute CBC-MAC using the AES/Rijndael cipher.  
 <a href="class_rijndael_c_b_c_m_a_c.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_rijndael_c_b_c_m_a_c_8h_source.html">RijndaelCBCMAC.h</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Collaboration diagram for RijndaelCBCMAC:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" frameborder="0" src="class_rijndael_c_b_c_m_a_c__coll__graph.svg" width="187" height="216"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a9a940cfd48cffb712783f557136b002b"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom">{ <a class="el" href="class_rijndael_c_b_c_m_a_c.html#a9a940cfd48cffb712783f557136b002ba7e95e2a4a7d3fec5297b8cde944ab968">BLOCK_SIZE</a> = 16
 }</td></tr>
<tr class="separator:a9a940cfd48cffb712783f557136b002b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a33dcb6f9c323155149d26f344f81260e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a33dcb6f9c323155149d26f344f81260e"></a>
typedef uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_rijndael_c_b_c_m_a_c.html#a33dcb6f9c323155149d26f344f81260e">block_t</a>[<a class="el" href="class_rijndael_c_b_c_m_a_c.html#a9a940cfd48cffb712783f557136b002ba7e95e2a4a7d3fec5297b8cde944ab968">BLOCK_SIZE</a>]</td></tr>
<tr class="memdesc:a33dcb6f9c323155149d26f344f81260e"><td class="mdescLeft">&#160;</td><td class="mdescRight">The cipher block data type. <br /></td></tr>
<tr class="separator:a33dcb6f9c323155149d26f344f81260e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aa6b84cb530a751c378832ca95fce9393"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_rijndael_c_b_c_m_a_c.html#aa6b84cb530a751c378832ca95fce9393">RijndaelCBCMAC</a> ()</td></tr>
<tr class="memdesc:aa6b84cb530a751c378832ca95fce9393"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor.  <a href="#aa6b84cb530a751c378832ca95fce9393">More...</a><br /></td></tr>
<tr class="separator:aa6b84cb530a751c378832ca95fce9393"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34cacbadcba7e0d6d7c1152deb44f93d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_rijndael_c_b_c_m_a_c.html#a34cacbadcba7e0d6d7c1152deb44f93d">RijndaelCBCMAC</a> (const <a class="el" href="class_a_e_s_key.html">AESKey</a>&lt; 128 &gt; &amp;key, const uint8_t *iv=0)</td></tr>
<tr class="memdesc:a34cacbadcba7e0d6d7c1152deb44f93d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="#a34cacbadcba7e0d6d7c1152deb44f93d">More...</a><br /></td></tr>
<tr class="separator:a34cacbadcba7e0d6d7c1152deb44f93d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a263a91d3e10abffdbd1912360b2e7cc1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_rijndael_c_b_c_m_a_c.html#a263a91d3e10abffdbd1912360b2e7cc1">update</a> (const uint8_t *data, unsigned length)</td></tr>
<tr class="memdesc:a263a91d3e10abffdbd1912360b2e7cc1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Process data.  <a href="#a263a91d3e10abffdbd1912360b2e7cc1">More...</a><br /></td></tr>
<tr class="separator:a263a91d3e10abffdbd1912360b2e7cc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b53be583501305e2dc173a87e7e8ee4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_rijndael_c_b_c_m_a_c.html#a8b53be583501305e2dc173a87e7e8ee4">finalize</a> ()</td></tr>
<tr class="memdesc:a8b53be583501305e2dc173a87e7e8ee4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Signal that all data has been processed.  <a href="#a8b53be583501305e2dc173a87e7e8ee4">More...</a><br /></td></tr>
<tr class="separator:a8b53be583501305e2dc173a87e7e8ee4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2212e0095ae743ef87dd6760ae443b0f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2212e0095ae743ef87dd6760ae443b0f"></a>
const <a class="el" href="class_rijndael_c_b_c_m_a_c.html#a33dcb6f9c323155149d26f344f81260e">block_t</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_rijndael_c_b_c_m_a_c.html#a2212e0095ae743ef87dd6760ae443b0f">getMAC</a> () const </td></tr>
<tr class="memdesc:a2212e0095ae743ef87dd6760ae443b0f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a reference to the current MAC value. <br /></td></tr>
<tr class="separator:a2212e0095ae743ef87dd6760ae443b0f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a50422499b592e2cfcd295a72ad1a6883"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a50422499b592e2cfcd295a72ad1a6883"></a>
<a class="el" href="class_rijndael_c_b_c_m_a_c.html">RijndaelCBCMAC</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_rijndael_c_b_c_m_a_c.html#a50422499b592e2cfcd295a72ad1a6883">operator=</a> (const <a class="el" href="class_rijndael_c_b_c_m_a_c.html">RijndaelCBCMAC</a> &amp;other)</td></tr>
<tr class="memdesc:a50422499b592e2cfcd295a72ad1a6883"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assignment operator. <br /></td></tr>
<tr class="separator:a50422499b592e2cfcd295a72ad1a6883"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:ae95141519cece1780e81b2d4222a062c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_rijndael_c_b_c_m_a_c.html#ae95141519cece1780e81b2d4222a062c">updateOneBlock</a> (const uint8_t *data)</td></tr>
<tr class="separator:ae95141519cece1780e81b2d4222a062c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:af757654ea97b4dea20155ef9b11e14b3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af757654ea97b4dea20155ef9b11e14b3"></a>
<a class="el" href="class_a_e_s_key.html">AESKey</a>&lt; 128 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_rijndael_c_b_c_m_a_c.html#af757654ea97b4dea20155ef9b11e14b3">m_key</a></td></tr>
<tr class="memdesc:af757654ea97b4dea20155ef9b11e14b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">128-bit key to use for the CBC-MAC. <br /></td></tr>
<tr class="separator:af757654ea97b4dea20155ef9b11e14b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2384cdd665a230b10cc0d56909c51164"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2384cdd665a230b10cc0d56909c51164"></a>
<a class="el" href="class_rijndael_c_b_c_m_a_c.html#a33dcb6f9c323155149d26f344f81260e">block_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_rijndael_c_b_c_m_a_c.html#a2384cdd665a230b10cc0d56909c51164">m_mac</a></td></tr>
<tr class="memdesc:a2384cdd665a230b10cc0d56909c51164"><td class="mdescLeft">&#160;</td><td class="mdescRight">Current message authentication code value. <br /></td></tr>
<tr class="separator:a2384cdd665a230b10cc0d56909c51164"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Class to compute CBC-MAC using the AES/Rijndael cipher. </p>
<p>Currently only supports 128-bit keys and block sizes. </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="a9a940cfd48cffb712783f557136b002b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">anonymous enum</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="a9a940cfd48cffb712783f557136b002ba7e95e2a4a7d3fec5297b8cde944ab968"></a>BLOCK_SIZE&#160;</td><td class="fielddoc">
<p>Number of bytes in one cipher block. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aa6b84cb530a751c378832ca95fce9393"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">RijndaelCBCMAC::RijndaelCBCMAC </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Default constructor. </p>
<p>The key and IV are both set to zero. </p>

</div>
</div>
<a class="anchor" id="a34cacbadcba7e0d6d7c1152deb44f93d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">RijndaelCBCMAC::RijndaelCBCMAC </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_a_e_s_key.html">AESKey</a>&lt; 128 &gt; &amp;&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>iv</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>The key to use as the CBC-MAC secret. </td></tr>
    <tr><td class="paramname">iv</td><td>Initialization vector. Defaults to zero if not provided. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a8b53be583501305e2dc173a87e7e8ee4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RijndaelCBCMAC::finalize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Signal that all data has been processed. </p>
<p>It appears that some forms of CBC-MAC encrypt the final output block again in order to protect against a plaintext attack. This method is a placeholder for such an operation, but it currently does nothing. </p>

</div>
</div>
<a class="anchor" id="a263a91d3e10abffdbd1912360b2e7cc1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RijndaelCBCMAC::update </td>
          <td>(</td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Process data. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>Pointer to data to process. </td></tr>
    <tr><td class="paramname">length</td><td>Number of bytes to process. Must be evenly divisible by <a class="el" href="class_rijndael_c_b_c_m_a_c.html#a9a940cfd48cffb712783f557136b002ba7e95e2a4a7d3fec5297b8cde944ab968" title="Number of bytes in one cipher block. ">BLOCK_SIZE</a>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ae95141519cece1780e81b2d4222a062c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void RijndaelCBCMAC::updateOneBlock </td>
          <td>(</td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>On entry the current value of m_mac becomes the initialization vector for the CBC encryption of this block. The output of the encryption then becomes the new MAC, which is stored in m_mac. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="_rijndael_c_b_c_m_a_c_8h_source.html">RijndaelCBCMAC.h</a></li>
<li>RijndaelCBCMAC.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_rijndael_c_b_c_m_a_c.html">RijndaelCBCMAC</a></li>
    <li class="footer">Generated on Mon Mar 7 2016 16:49:51 for Kinetis Bootloader Host by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
